bitkeeper revision 1.1159.187.11 (41a5f544EJGqYIJJBOFjrPctFG4vhA)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Thu, 25 Nov 2004 15:07:48 +0000 (15:07 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Thu, 25 Nov 2004 15:07:48 +0000 (15:07 +0000)
Add wildcard capability to the KERNELS= input to the top-level Makefile.
e.g. make KERNELS=*2.4* world

Makefile

index a3675f7634d0f4c83e9d5e1f8e0e26c7304a9cb8..83a844202eb4ffa3ce0d175f49527bc71c87dd89 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,9 +7,12 @@ INSTALL_DIR ?= $(DIST_DIR)/install
 
 KERNELS ?= linux-2.6-xen0 linux-2.6-xenU
 # linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-xenU
+# You may use wildcards in the above e.g. KERNELS=*2.4*
 
 ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
 ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
+XKERNELS := $(foreach kernel, $(KERNELS), $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.$(kernel))) )
+
 
 export INSTALL_DIR
 
@@ -46,7 +49,7 @@ tools:
        $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C tools install
 
 kernels:
-       for i in $(KERNELS) ; do $(MAKE) $$i-build ; done
+       for i in $(XKERNELS) ; do $(MAKE) $$i-build ; done
 
 docs:
        sh ./docs/check_pkgs && \
@@ -57,11 +60,11 @@ kbuild: kernels
 
 # Delete the kernel build trees entirely
 kdelete:
-       for i in $(KERNELS) ; do $(MAKE) $$i-delete ; done
+       for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done
 
 # Clean the kernel build trees
 kclean:
-       for i in $(KERNELS) ; do $(MAKE) $$i-clean ; done
+       for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done
 
 # Make patches from kernel sparse trees
 mkpatches: